package com.PVZ.engine;

import com.PVZ.engine.factory.BulletFactory;
import com.PVZ.engine.factory.GettableFactory;
import com.PVZ.engine.factory.PlantFactory;
import com.PVZ.engine.factory.ZombieFactory;
import com.PVZ.engine.map.level.Level;
import com.PVZ.model.Entity;
import com.PVZ.model.emuns.MoveType;
import com.PVZ.model.plant.*;
import com.PVZ.model.zombie.*;
import lombok.Data;
import org.checkerframework.checker.units.qual.C;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
 * Created by @Author: kabuda on @Date: 2021/5/18 20:40
 * <p>
 * 游戏发生的场所 所有逻辑都在这里被调用
 */
@Data
public class Stage {


    public static int sunQuantity = 500;
    //当前关卡
    private Level level;

    private PlantFactory plantFactory;

    private ZombieFactory zombieFactory;

    private BulletFactory bulletFactory;

    private volatile GettableFactory gettableFactory;

    private volatile List<Entity> allEntityList;

    private Boolean isOver = false;


    public Stage(Level level) {
        this.level = level;
        level.getGameMap().mapInitial();
        zombieFactory = level.getZombieFactory();
        plantFactory = level.getPlantFactory();

        bulletFactory = new BulletFactory();
        gettableFactory = new GettableFactory();

        allEntityList = new ArrayList<>();

    }

}
